


#include "lua-chess.h"
#include "cfish.h"

static int 
myadd(lua_State *L){
	cfish_run();
    int a = luaL_checknumber(L, 1);
	int b = luaL_checknumber(L, 2);
    
    const char *s = "hello lua";
    lua_pushstring(L, s);
    printf("free s");
	return 1;
}

static const struct luaL_Reg mylib [] = {
	{"add", myadd}, 
	{NULL, NULL}
};

int luaopen_chess(lua_State *L){
	luaL_newlib(L, mylib);
	return 1;
}
